// ===================================
// <copyright>
// This file is part of LABSMFController.
//
//    LABSMFController is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    LABSMFController is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with LABSMFController.  If not, see <http://www.gnu.org/licenses/>.
//    Copyright 2011 David Bakker
//
//</copyright>
// <author>David Bakker</author>
// <email>mailto:DavidFBakker@gmail.com</email>
// <created>Saturday, May 07, 2011</created>
// <lastedit>Saturday, May 07, 2011</lastedit>
// ===================================

using System;

namespace LABSMFController.LABS.Classses
{
    public static class QueueResponseType
    {
        //public static int Anything = 0;
        public static int String = 1;
        public static int Integer = 2;
        public static int Double = 3;

        public static Type[] TypeMatch = new Type[4];

        static QueueResponseType()
        {
          //  TypeMatch[None] = null;
            TypeMatch[String] = typeof(string);
            TypeMatch[Integer] = typeof (int);
            TypeMatch[Double] = typeof(Double);
        }

        public static string GetResponseName(int responseType)
        {
            if (responseType == String) return "String";
            if (responseType == Integer) return "Integer";
            if (responseType == Double) return "Double";
            return "Anything";
        }

    }

    #region Nested type: Queue

    public class Queue
    {              
        public Queue()
        {
            Answer = null;
            IsAnswered = false;
        }

        public int RequestID { get; set; }
        public string Message { get; set; }
        public string CallingClass { get; set; }
        public bool IsAnswered { get; set; }
        public int ResponseType { get; set; }
        private object _answer;
        public object Answer
        {
            get { return _answer; }
            set
            {
                IsAnswered = true;
                _answer = value;
            }
        }
    }

    #endregion
}